﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ProductsManager.ascx.cs"
    Inherits="BONSAI.Admin.UC.ProductsManager" %>
<table cellpadding="0" cellspacing="0" width="100%" style="padding-top: 10px; padding-left: 5px;
    padding-right: 5px;">
    <tr>
        <td style="padding-left: 4px; padding-right: 4px;">
            <img src="Image2/lua.png" /> <span style="font-weight: bold; font-size: 10pt;">
            SẢN PHẨM</span><hr />
        </td>
    </tr>
    <tr>
        <td align="left">
            <table cellpadding="0" cellspacing="0" style="width: 100%; margin-left: 5px;">
                <tr>
                    <td align="left" style="height: 40px; background-color: #f5f1ea;" class="tdfuncyion">
                        <asp:LinkButton ToolTip="Tạo mới gương mặt tu nghiệp sinh." CssClass="functionAS"
                            ID="lbcreate" runat="server" OnClick="lbcreate_Click"><img  alt=""  style="border: 0px;vertical-align: middle;" src="ImageAdmin/add_create.png" /> &nbsp;Tạo mới</asp:LinkButton>
                        &nbsp; &nbsp;
                        <img alt="" style="border: 0px; vertical-align: middle;" src="ImageAdmin/Delete.png" />
                        <a href="#" title="Chọn checkbox 'Chọn tất cả', sau đó click chức năng này để xóa tất cả nội dung."
                            class="functionAS" style="cursor: pointer;" onclick="DeleteAllV2()">Xóa tất cả</a>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
    <tr>
        <td style="height: 10px;">
        </td>
    </tr>
    <tr>
        <td valign="top" align="left">
            <fieldset>
                <legend style="color: Blue;">DANH SÁCH SẢN PHẨM</legend>
                <br />
                Loại SP: 
                <asp:DropDownList ID="droptypetours" runat="server">
                </asp:DropDownList>
               
                <asp:Button ID="Button1" runat="server" Text="Tìm" 
                    onclick="Button1_Click" />
                
                <br />    <br />    <br />
                <hr />
                <asp:GridView Width="100%" ID="GridView1" runat="server" AutoGenerateColumns="False"
                    CellPadding="4" ForeColor="Black" EmptyDataText="Không tìm thấy dữ liệu !" DataKeyNames="ProductsID"
                    BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px"
                    AllowPaging="True" PageSize="20" OnPageIndexChanging="GridView1_PageIndexChanging"
                    OnRowDeleting="GridView1_RowDeleting" onrowcommand="GridView1_RowCommand">
                    <RowStyle HorizontalAlign="Left" />
                    <Columns>
                        <asp:TemplateField HeaderStyle-HorizontalAlign="Center" HeaderText="">
                            <HeaderTemplate>
                                <input id="changeCheckStateId" title="Chọn tất cả." onclick="changeCheckState(this.checked);"
                                    runat="server" type="checkbox" />
                            </HeaderTemplate>
                            <ItemTemplate>
                                <input  type="checkbox" value='<%#Eval("ProductsID")%>' id="checkBox"
                                    runat="server" />
                            </ItemTemplate>
                            <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                            <ItemStyle HorizontalAlign="Center" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderStyle-HorizontalAlign="Left" HeaderText="ID">
                            <ItemTemplate>
                                <span>
                                    <%#Eval("ProductsID")%>
                                </span>
                            </ItemTemplate>
                            <HeaderStyle HorizontalAlign="Left"></HeaderStyle>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderStyle-HorizontalAlign="Left" HeaderText="Tên sp ngắn">
                            <ItemTemplate>
                                <span>
                                    <%#Eval("NameFull")%>
                                </span>
                            </ItemTemplate>
                            <HeaderStyle HorizontalAlign="Left"></HeaderStyle>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderStyle-HorizontalAlign="Left" HeaderText="Tên sp dài">
                            <ItemTemplate>
                                <span>                                
                                    <%#Eval("NameFull")%>
                                </span>
                            </ItemTemplate>
                            <HeaderStyle HorizontalAlign="Left"></HeaderStyle>
                           
                        </asp:TemplateField>
                        <asp:TemplateField HeaderStyle-HorizontalAlign="Left" HeaderText="">
                            <HeaderTemplate>
                                <img alt="" src="ImageAdmin/icon5.png" />
                            </HeaderTemplate>
                            <ItemTemplate>
                                <a title="Cập nhật ảnh sp"  href="PhotoManager.aspx?type=<%#Eval("ProductsID")%>"> <img style="border:0px;height:20px;width:20px;"  alt="Hình ảnh" src="ImageAdmin/view-fullscreen.png" /> </a> 
                            </ItemTemplate>
                            <HeaderStyle HorizontalAlign="Left"></HeaderStyle>
                        </asp:TemplateField>
                                              
                                               
                        <asp:TemplateField HeaderStyle-HorizontalAlign="Left" HeaderText="">
                            <HeaderTemplate>
                                <img alt="" src="ImageAdmin/icon2.png" />
                            </HeaderTemplate>
                            <ItemTemplate>
                                <a title="Cập nhật sp" href="ProductsUpdate.aspx?id=<%#Eval("ProductsID")%>"><img style="border:0px;height:20px;width:20px;"  alt="" src="ImageAdmin/icon2.png" /></a> 
                            </ItemTemplate>
                            <HeaderStyle HorizontalAlign="Left"></HeaderStyle>
                        </asp:TemplateField>
                        
                         <asp:TemplateField ShowHeader="False">
                            <HeaderTemplate>
                                <%--<img alt="" style="width: 20px; height: 20px;" src="ImageAdmin/edit-cut.png" />--%>
                            </HeaderTemplate>
                            <ItemTemplate>
                                <asp:LinkButton OnClientClick="return ConformActive()" ID="LinkButton2" runat="server"
                                    CausesValidation="False" CommandArgument='<%#Eval("ProductsID") %>'  CommandName="choosenew" Text="sp moi" ToolTip="chọn sp mới"></asp:LinkButton>
                            </ItemTemplate>
                        </asp:TemplateField>
                        
                        <asp:TemplateField ShowHeader="False">
                            <HeaderTemplate>
                                <img alt="" style="width: 20px; height: 20px;" src="ImageAdmin/edit-cut.png" />
                            </HeaderTemplate>
                            <ItemTemplate>
                                <asp:LinkButton OnClientClick=" return ConformDelete()" ID="LinkButton1" runat="server"
                                    CausesValidation="False" CommandName="Delete" Text="Xóa"></asp:LinkButton>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <FooterStyle BackColor="#CCCC99" ForeColor="Black" />
                    <SelectedRowStyle BackColor="#CC3333" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="White" ForeColor="Black" HorizontalAlign="Right" />
                    <HeaderStyle BackColor="Gray" Font-Bold="True" ForeColor="White" HorizontalAlign="Left" />
                    <AlternatingRowStyle HorizontalAlign="Left" />
                </asp:GridView>
            </fieldset>
        </td>
    </tr>
</table>
<input type="hidden" id="hdc" value="false" />

<script language="javascript" type="text/jscript">
    function ConformDeleteTC()
    {
       var ch = document.getElementById("hdc");
       if(ch.value=="false")
       {
          alert("Bạn phải chọn nội dung muốn xóa.");
          return false;
       }       
       return window.confirm("Bạn có chắc bạn muốn xóa tất cả nội dung này không?");
    }
</script>

<script language="javascript" type="text/javascript">
    function DeleteAllV2()
    {
       
       var ch = document.getElementById("hdc");
       if(ch.value=="false")
       {
          alert("Bạn phải chọn nội dung muốn xóa.");
          //return cancelEvent();
       }       
       else
       {
             if(window.confirm("Bạn có chắc bạn muốn xóa tất cả nội dung này không?")==true)
             {                 
                 //var id = GetPara('id');                
                
                 location.href = "FaceStudentManager.aspx?zxc=1qwertyuiop";
             }                  
        }
    }
    function KetQua(kq)
    {
       //alert(kq);
    }
</script>

